import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'dart:async';
import 'package:flutter/animation.dart';

class LoadingPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => new LoadingPagePageState();
}
class LoadingPagePageState extends State<LoadingPage>{
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    _changeValue();
  }
  @override
  void dispose() {
    // TODO: implement dispose
    super.dispose();
    time.cancel();
  }
  Timer time;
  double animValue = 15.0;
  double animValue1 = 15.0;
  double animValue2 = 15.0;
  List<double> number=[15.0,15.0,15.0];
  _changeValue() {
    var i=0;
    bool status=true;
    time=Timer.periodic(Duration(milliseconds: 500), (time){
      setState(() {
        if(i==number.length){
          i=0;
          number.sort();
        }
        if(i==0){
          number.sort();
        }
        number[i]= number[i] == 15?5.0:15.0;
        i++;
      });
    });

  }
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
        body: Align(
          child: new Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              new AnimatedContainer(
                width: number[0] ,
                height: number[0] ,
                margin: EdgeInsets.all(5.0),
                curve: Curves.easeInOut,
                duration: new Duration(seconds: 1),
                decoration: new BoxDecoration(
                  color: Colors.pinkAccent,
                  borderRadius: new BorderRadius.all(Radius.circular(10.0)),
                ),
              ),
              new AnimatedContainer(
                width: number[1],
                height: number[1],
                margin: EdgeInsets.all(5.0),
                curve: Curves.easeInOut,
                duration: new Duration(seconds: 1),
                decoration: new BoxDecoration(
                  color: Colors.pinkAccent,
                  borderRadius: new BorderRadius.all(Radius.circular(10.0)),
                ),
              ),
              new AnimatedContainer(
                width: number[2],
                height:  number[2],
                margin: EdgeInsets.all(5.0),
                curve: Curves.easeInOut,
                duration: new Duration(seconds: 1),
                decoration: new BoxDecoration(
                  color: Colors.pinkAccent,
                  borderRadius: new BorderRadius.all(Radius.circular(10.0)),
                ),
              ),
            ],
          ),
        ));
  }
}

